
	
function test(){
	alert("dosomething");
	
}

function addLog(text){
	var log = 	getById("$log");
	log.innerText = log.innerText + text + " \n"; 
}

function focusComponent(id){
	addLog("focus on Component " +id);
}

function blurComponent(id){
	addLog("blur on component "+id);
}

/* Compatibility Tested ~
IE6 - true
IE7 - true
IE8 - true
Chrome 5 + 6 - true
Safari(pc) 4.0.x - true
Firefox 3.6.x - true
Opera 10.53 - false
*/
/* References + Notes ~
* window.onbeforeunload is an event that fires prior to the unload event when the page is unloaded
* MSDN Reference : http://msdn.microsoft.com/en-us/library/ms536907(VS.85).aspx
* Moz Reference : https://developer.mozilla.org/en/DOM/window.onbeforeunload
* This Event came out in IE4 and isnt in a public specification
*/

//Bit Of Cross Browser Smashing
try{
	// http://www.opera.com/support/kb/view/827/
	opera.setOverrideHistoryNavigationMode('compatible');
	history.navigationMode = 'compatible';
}catch(e){}

//Our Where The F' Are You Going Message
function ReturnMessage()
{
	return "WTF!!!";
}

//UnBind Function
function UnBindWindow()
{
	window.onbeforeunload = null;
	return true;
}

//Bind Links we dont want to affect
document.getElementById('homebtn').onclick = UnBindWindow;
document.getElementById('googlebtn').onclick = UnBindWindow;

//Bind Exit Message Dialogue
window.onbeforeunload = ReturnMessage;	
	
